<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .fu {
            width: 400px;
            height: 400px;
            position: relative;
            perspective: 1000px;
        }

        .zheng,
        .fan {
            width: 100%;
            height: 100%;
            position: absolute;
            transition: all 5s;
        }

        .zheng {
            background-color: blue;
        }

        .fan {
            background-color: brown;
        }

        .fu:hover div {
            transform: rotateY(180deg);
        }
        /* 不是正面朝上的时候就隐藏 */
        .fu div:first-child{
            backface-visibility: hidden;
        }
        
    </style>
</head>

<body>

    <div class="fu">
        <div class="zheng"></div>
        <div class="fan"></div>
    </div>
</body>

</html>